package com.jxc.jxc01.grc.web;

import com.jxc.jxc01.grc.service.IProcurementService;
import com.jxc.jxc01.grc.service.impl.ProcurementSreviceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(value = "/deletprocurement")
public class DeletProcurementServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request,
                           HttpServletResponse response)
            throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        String id = request.getParameter("id");
        IProcurementService iProcurementService = new ProcurementSreviceImpl();
        int i = iProcurementService.deleteProcurement(Integer.parseInt(id));
        if (i>0){
            System.out.println("删除成功");
        }
    }
}
